import 'package:dio/dio.dart';
import 'dart:async';
import 'dart:io';
import '../config/service_url.dart';


/// 获取首页主题内容

Future getHomePageContent() async {
  print('开始获取首页数据....');

  try{
    Response response;
    Dio dio = new Dio();
    dio.options.contentType = ContentType.parse('application/x-www-form-urlencoded');
    /// 表单 经纬度
    var formData = {'lon': '113.9495640733507', 'lat' : '22.556802842881943'};
    response = await dio.post(servicePath['homePageContent'], data: formData);
    if (response.statusCode == 200) {
      return response.data;
    } else {
      throw Exception('后端接口出现异常');
    }
  } catch(error) {
    return print('Error: ====>${error}');
  }

}